package net.googlecode.demenkov.task3;

import java.math.BigDecimal;

/**
 * Superclass for Employee,Boss and Manager classes. Represents personal information about staff.
 */
public class PersonalInfo {
    private String firstName;
    private String lastName;
    private int age;
    private BigDecimal rate;
    protected boolean perHour;
    protected boolean bonus;
    private BigDecimal bonusAmT;


    /**
     * Constructor, creater a person.
     *
     * @param firstName person's firstname.
     * @param lastName  person's lastname.
     */
    public PersonalInfo(final String firstName, final String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.bonusAmT = BigDecimal.ZERO;
        this.perHour = true;
        this.bonus = true;
    }

    /**
     * Gets name on a person.
     *
     * @return firstname lastname
     */
    public String getName() {
        return firstName + " " + lastName;
    }

    /**
     * Gets age of a person.
     *
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * Sets person's age.
     *
     * @param age person's age.
     */
    public void setAge(final int age) {
        this.age = age;
    }

    /**
     * Gets person's rate.
     *
     * @return person's rate.
     */
    public BigDecimal getRate() {
        return this.rate;
    }

    /**
     * Sets person's rate.
     *
     * @param rate person's rate.
     */
    public void setRate(final BigDecimal rate) {
        this.rate = rate;
    }

    /**
     * Gets person's Bonus amount.
     *
     * @return person't bonus amount
     */
    public BigDecimal getBonusAmount() {
        return this.bonusAmT;
    }

    /**
     * Sets person's bonus amount.
     *
     * @param bonusAmount person's bonus amount
     */
    public void setBonusAmount(final BigDecimal bonusAmount) {
        this.bonusAmT = bonusAmount;
    }


    /**
     * Checks if person has rate per hour.
     *
     * @return true if person has rate per hour.
     */
    public boolean isPerHour() {
        return perHour;
    }


    /**
     * Checks if person has a bonus.
     *
     * @return true if person has a bonus.
     */
    public boolean isBonus() {
        return bonus;
    }


}
